<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
	<html>
		<body bgcolor="#0099FF">
			<h2 align="center"><font color="#FF4400">To Do List</font></h2><hr></hr>
			<table border="3">
				<tr bgcolor="#6666FF">
					<th align="center">Nombre</th>
					<th align="center">Descripcion</th>
					<th align="center">Fecha</th>
					<th align="center">Autor</th>
				</tr>
				<xsl:for-each select="todo/item">
				<tr bgcolor="white">
				<xsl:choose>
					<xsl:when test="prior = 1">
						<th align="center" bgcolor="lime"><xsl:value-of select="name"/></th>
					</xsl:when>
					<xsl:when test="prior = 2">
						<th align="center" bgcolor="yellow"><xsl:value-of select="name"/></th>
					</xsl:when>
					<xsl:when test="prior = 3">
						<th align="center" bgcolor="red"><xsl:value-of select="name"/></th>
					</xsl:when>
					<xsl:otherwise>
						<th align="center" bgcolor="blue"><xsl:value-of select="name"/></th>
					</xsl:otherwise>
					</xsl:choose>
						<td align="justify"><xsl:value-of select="description"/></td>
						<td><xsl:value-of select="@date"/></td>
						<td><xsl:value-of select="@author"/></td>
				</tr>
				</xsl:for-each>
			</table>
			<hr></hr><center>
			<table border="1">
				<tr><th colspan="2">Leyenda</th></tr>
				<tr><th>Color</th><th>Prioridad</th></tr>
				<tr><td bgcolor="lime"></td><td align="center">1</td></tr>
				<tr><td bgcolor="yellow"></td><td align="center">2</td></tr>
				<tr><td bgcolor="red"></td><td align="center">3</td></tr>
				<tr><td bgcolor="blue"></td><td align="center">UNDEF</td></tr>
			</table></center>
		</body>
	</html>
</xsl:template>

</xsl:stylesheet>